﻿using ChatBackend.Common.Enums;
using SqlSugar;

namespace ChatBackend.Entity.Entities
{
    [SugarTable("User")]
    public class UserEntity : BaseEntity
    {
        public UserEntity() { }
        public UserEntity(string userName, string UID, string PWD, Gender gender)
        {
            UserName = userName;
            this.UID = UID;
            Gender = gender;
            this.PWD = PWD;
        }

        /// <summary>
        /// 用户名
        /// </summary>
        public string UserName { get; set; }

        /// <summary>
        /// 账号
        /// </summary>
        public string UID { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        public string PWD { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        public Gender Gender { get; set; }

        /// <summary>
        /// 账号状态
        /// </summary>
        public AccountStatus AccountStatus { get; set; }

        /// <summary>
        /// 最后登录IP
        /// </summary>
        [SugarColumn(IsOnlyIgnoreInsert = true, IsNullable = true)]
        public string? LoginIP { get; set; }

        /// <summary>
        /// 最后登录时间
        /// </summary>
        [SugarColumn(IsOnlyIgnoreInsert = true, IsNullable = true)]
        public DateTime? LoginDate { get; set; }
    }
}